<template>
  <van-nav-bar @click-left="onClickLeft" fixed placeholder>
    <template #left>
      <van-icon name="arrow-left" class="back_icon" />
      <slot class="back" name="back"></slot>
    </template>
    <template #right>
      <slot class="back" name="save"></slot>
    </template>
  </van-nav-bar>
</template>

<script>
export default {
  name: 'TopBack',
  methods: {
    onClickLeft () {
      this.$router.go(-1)
    }
  }
}
</script>

<style lang="scss" scoped>
.back,
.back_icon {
  padding-right: 6px;
  color: #333 !important;
}
</style>
